package xiangmu.schoolpaper.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import xiangmu.schoolpaper.pojo.VO.*;

import java.util.List;

@Mapper
public interface AdminDataListMapper {

    List<Integer> graduationYear(Integer facultyId);

    @Select("SELECT account,name FROM user where faculty_id=#{facultyId} and role_id=3")
    List<SystemNameAndAccount> nameAndId(Integer facultyId);

    IPage<SystemSplitStudentInfo> getAllStudentPaper(
            Page<SystemSplitStudentInfo> page,
            Integer facultyId,
            Integer graduationYear,
            String studentAccount,
            String paperTitle
    );

    IPage<ExtractContentVO> extractContent(
            Page<ExtractContentVO> page,
            Integer facultyId,
            Integer graduationYear,
            String studentAccount,
            String paperTitle
    );

    IPage<SystemOneScoreVO> allPaperScore(
            Page<SystemOneScoreVO> page,
            Integer facultyId,
            Integer graduationYear,
            String studentAccount,
            String paperTitle
    );

    // 查最新一篇论文的基本信息
    SystemAllScoreAndSuggestByStudentAccountVO getPaperInfoByStudentId(Integer studentId);

    // 查对应论文的 factor 列表
    List<SystemOneFactorInfoVO> getFactorsByPaperId(Integer paperId);

    Integer getStudentIdByStudentAccount(String studentAccount);
}
